<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>
            <router-link to='/'>首页</router-link>
            <router-link to='/student'>学生列表</router-link>
            <router-link to='/teacher'>教师列表</router-link>
            <router-link to='/others'>其他人列表</router-link>
        </div>
        <router-view></router-view>
    </div>
    <script src="../js/vue.min.js"></script>
    <script src="../js/vue-router.min.js"></script>
    <script>
        let routes = [
            {path: '/', component: {template: '<div>index</div>'}},
            {path: '/student', component: {template: '<div>student List</div>'}},
            {path: '/teacher', component: {template: '<div>teacher List</div>'}},
            {path: '/others', component: {template: '<div>others List</div>'}}
        ]
        let router = new VueRouter({
            routes:routes
        });
        new Vue({
            el: '#app',
            data: {
                
            },
            router
        })
    </script>
</body>

</html>